package com.study.spring.boot.model.error;

import com.study.spring.boot.enums.ErrorCode;

/**
 * @ClassName: ServiceException
 * @Description: 统一异常封装
 * @author: limingxing
 * @Date: 2021/1/10  17:46
 */
public class ServiceException extends BaseException{

    public ServiceException(ErrorCode errorCode) {
        error.setCode(errorCode.getError());
        error.setMessage(errorCode.getCnMsg());
    }

    public ServiceException(String code ,String message) {
        error.setCode(code);
        error.setMessage(message);
    }
}
